<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: edit.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright © since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	© 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	© 2002-2003 osCommerce - www.oscommerce.com
* 	© 2003     nextcommerce - www.nextcommerce.org
* 	© 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

defined('_VALID_XTC') or die('Direct Access to this location is not allowed.');

echo draw_form('slider', 'slider.php', 'save=edit&'.getMenuID('slider'), 'POST', 'id="slider"'); ?>
	<table width="100%" cellpadding="5">
		<tr>
			<td width="40%">
				<table width="100%" cellpadding="5">
					<?php
						$languages = get_languages();
						foreach($languages AS $lang) { $i++;
							$img = $db->db_query("SELECT
														image_id,
														image_name,
														link,
														description
													FROM
														".TABLE_SLIDER_IMAGES."
													WHERE
														slider_id = ".(int)$_GET['slider_id']."
													AND
														language_id = '".(int)$lang['id']."' ");
							if($img->_numOfRows) {
								while(!$img->EOF) { ?>
									<tr>
										<td rowspan="2" width="1" valign="top">
											<img style="-moz-box-shadow:0 2px 4px rgba(0,0,0,0.5);-webkit-box-shadow:0 2px 4px rgba(0,0,0,0.5);box-shadow:0 2px 4px rgba(0,0,0,0.5)" src="../images/slider/slider_thumb/<?php echo $img->fields['image_name'] ?>" alt="" />
										</td>
										<td width="1"><nobr><?php echo '<img src="../lang/'.$lang['directory'].'/'.$lang['image'].'" alt="'.$lang['name'].'" />'; ?> Link:</nobr></td>
										<td>
											<?php echo draw_input_field('slider_link_'.$lang['id'].'_'.$img->fields['image_id'], $img->fields['link'], 'style="width:98%"'); ?>
										</td>
										<td rowspan="3" width="24" align="center" valign="middle">
											<a href="?do=del_pic&image_id=<?php echo $img->fields['image_id'] ?>&slider_id=<?php echo $_GET['slider_id'] ?>" title="Diese Grafik + Texte löschen!">
												<img style="cursor:pointer;" src="images/icons/cross.png" alt="Diese Grafik + Texte löschen!" />
											</a>
										</td>
									</tr>									
									<tr>
										<td valign="top"><nobr><?php echo '<img src="../lang/'.$lang['directory'].'/'.$lang['image'].'" alt="'.$lang['name'].'" />'; ?> Beschreibung:</nobr></td>
										<td>
											<textarea name="slider_description_<?php echo $lang['id'].'_'.$img->fields['image_id'] ?>"><?php echo str_replace('<br />', "\n",$img->fields['description']) ?></textarea>
										</td>
									</tr>
									<tr><td colspan="4" style="border-top: 1px solid #ccc">&nbsp;</td></tr>
									<?php 
									$img->MoveNext();
								}
							} 
						} 
					?>
				</table>
			</td>
		</tr>		
	</table>
	<?php echo draw_hidden_field('slider_id', (int)$_GET['slider_id']); ?>
</form>